"""
给定两个整数A和B，输出从A到B的所有整数以及这些数的和。
"""
a, b = input().split()
a, b = int(a),int(b)
count = 0
sum = 0
for i in range(a, b+1):
    sum += i
    count += 1
    if count == 5:
        print("{:>5d}".format(i), end='\n')
        count = 0
    elif i == b:
        print("{:>5d}".format(i), end='\n')
    else:
        print("{:>5d}".format(i), end='')
print(f'Sum = {sum}')

